import React, { Component } from 'react'

export default class Add extends Component {
    handleSubmit = (e) => {
        e.preventDefault();
        console.log(this.input);
    
        this.props.history.push({
            pathname: `/user/list/${this.input.value}`,
            state: {
                a: 1,
                b: 2
            }
        })
    }
    render() {
        console.log(this.props)
        return (
            <form onSubmit={this.handleSubmit} >
                <input type='text' required ref={dom => this.input = dom}/>
                <button>submit</button>
            </form>
        )
    }
}
